package model

import "time"

type User struct {
	Id          int    `orm:"column(id);type(int);auto;pk"`
	Name        string `orm:"column(name);size(64);"`
	Password    string `orm:"column(password);size(40);"`
	Salt        string `orm:"column(salt);size(40);"`
	PhoneNumber string `orm:"column(phone_number);size(40);"`
	Address     string `orm:"column(address);size(64)"`
	// 私钥
	Key string `orm:"column(key);type(text)"`
	// 公钥
	Cert string `orm:"column(cert);type(text)"`
	// 连续登录失败次数
	FailTimes int `orm:"column(fail_times);type(int)"`
	//账号是否被冻结（只能管理员解锁）
	Locked bool `orm:"column(locked);type(boolean)"`
	// 上一次锁定时间
	LockedTime  time.Time `orm:"column(locked_time);null;type(datetime)"`
	CreatedTime time.Time `orm:"column(created_time);auto_now_add;type(datetime)"`
	UpdateTime  time.Time `orm:"column(update_time);auto_now;type(datetime)"`
	PwdChanged  bool      `orm:"column(pwdchanged);type(boolean)"`
	// 角色id  这里创建的外键需要注意
	Role *Role `orm:"column(role_id);rel(fk)"`
	// 是否已经人证核身
	Authenticated    bool   `orm:"column(authenticated);type(boolean)"`
	FirstLogin       bool   `orm:"column(first_login);type(boolean)"`
	AssetObtainedNum int    `orm:"column(asset_obtained_num);type(int)"`
	ProfilePhotoUrl  string `orm:"column(profile_photo_url);type(string)"`
}
